<?php if (!defined('SHUIPF_VERSION')) exit(); ?>






<Admintemplate file="Common/DatabaseHead"/>




<body class="J_scroll_fixed">
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>数据库工具</em></a><span>|</span><a href='javascript:;' class="on"><em>数据库导出</em></a><span>|</span><a href='./?g=Admin&m=Database&a=import' ><em>数据库导入</em></a>    
		</div>
</div>
<style type="text/css">
	html{_overflow-y:scroll}
</style><div class="pad_10">
<div class="table-list">
<form method="post" name="myform" id="myform" action="?g=admin&m=database&a=export">
<input type="hidden" name="tabletype" value="shuipfcms" id="phpcmstables">
<table width="100%" cellspacing="0">
<thead>
  	<tr>
    	<th class="tablerowhighlight" colspan="4">分卷备份设置</th>
  	</tr>
</thead>
  	<tr>
	    <td class="align_r">每个分卷文件大小</td>
	    <td colspan="3"><input type="text" name="sizelimit" value="2048" size="5"> K</td>
  	</tr>
   	<tr>
	    <td class="align_r">建表语句格式</td>
	    <td colspan="3"><input type="radio" name="sqlcompat" value="" checked> 默认 &nbsp; 
		<input type="radio" name="sqlcompat" value="MYSQL40"> MySQL 3.23/4.0.x &nbsp; 
		<input type="radio" name="sqlcompat" value="MYSQL41"> MySQL 4.1.x/5.x &nbsp;</td>
  	</tr>
   	<tr>
	    <td class="align_r">强制字符集</td>
	    <td colspan="3"><input type="radio" name="sqlcharset" value="" checked> 默认&nbsp; 
		<input type="radio" name="sqlcharset" value="latin1"> LATIN1 &nbsp; 
		<input type="radio" name="sqlcharset" value='utf8'> UTF-8</option></td>
  	</tr>

   	<tr>
	    <td class="align_r">备份文件名</td>
	    <td colspan="3">
		<input type="text" name="sqlfilename" value="{$sqlfilename}" size="25">.sql
		</td>
  	</tr>


   	<tr>
	    <td class="align_r">压缩分卷文件</td>
	    <td colspan="3">
		<input type="radio" class="box" name="compression" value="0" checked>不压缩<br />
		<input type="radio" class="box" name="compression" value="1" >多分卷压缩成一个文件
		</td>
  	</tr>



  	<tr>
	    <td></td>
	    <td colspan="3"><input type="submit" name="dosubmit" value=" 开始备份数据 " class="button"></td>
  	</tr>
</table>

    <table width="100%" cellspacing="0">
    
	<thead><tr><th align="center" colspan="9"><strong>数据库中共有{$tables}张表，共计{$total}</strong></th></tr></thead>
    <thead>
       <tr>
           <th width="10%"><input type="checkbox" value="" id="check_box" onclick="selectall('tables[]');"> <a class="cu" href="javascript:void(0);" onclick="reselect()">反选</a></th>
           <th width="10%" >表名</th>
           <th width="10%">类型</th>
           <th width="10%">编码</th>
           <th width="15%">记录数</th>
           <th width="15%">使用空间</th>
           <th width="8%">碎片</th>
		   <th width="7%">索引</th>
            <th width="15%">操作</th>
       </tr>
    </thead>
    <tbody>

	<volist name="list" id="tab">
	<tr>
		<td  width="5%" align="center"><input type="checkbox" name="tables[]" value="{$tab.Name}"/></td>
		<td  width="10%" align="left">{$tab.Name}</td>
		<td  width="10%" align="center">{$tab.Engine}</td>
		<td  width="10%" align="center">{$tab.Collation}</td>
		<td  width="15%" align="center">{$tab.Rows}</td>
		<td  width="15%" align="center">{$tab.size}</td>
		<td  width="8%" align="center">{$tab.Data_free}</td>
		<td  width="7%" align="center">{$tab.Index_length}</td>
		<td  width="15%" align="center">
		<a href="?g=Admin&m=Database&a=optimize&operation=optimize&tables={$tab.Name}">优化</a> | 
		<a href="?g=Admin&m=Database&a=optimize&operation=repair&tables={$tab.Name}">修复</a> | 
		<a href="javascript:void(0);" onclick="showcreat('{$tab.Name}','{$tab.Name}')">结构</a></td>
	</tr>
	</volist>
		

		</tbody>
</table>
 <div class="btn">
<label for="check_box">全选/取消</label>
<input type="button" class="button" onclick="reselect()" value="反选"/>


<input type="submit" class="button" name="dosubmit" onclick="document.myform.action='?g=Admin&m=Database&a=optimize&operation=optimize'" value="批量优化"/>


<input type="submit" class="button" name="dosubmit" onclick="document.myform.action='?g=Admin&m=Database&a=optimize&operation=repair'" value="批量修复"/>
</div>
</form>
</div>
</div>
</form>
</body>
<script type="text/javascript">
<!--
function show_tbl(obj) {
	var pdoname = $(obj).val();
	location.href='?m=admin&c=database&a=export&pdoname='+pdoname+'&pc_hash=VmQHD9';
}
function showcreat(tblname, pdo_name) {
	art.dialog({title:tblname, id:'show', iframe:'?g=Admin&m=Database&a=optimize&operation=showcreat&pdo_name='+pdo_name+'&tables=' +tblname,width:'500px',height:'350px'});
}
function reselect() {
	var chk = $("input[name=tables[]]");
	var length = chk.length;
	for(i=0;i < length;i++){
		if(chk.eq(i).attr("checked")) chk.eq(i).attr("checked",false);
		else chk.eq(i).attr("checked",true);
	}
}
//-->
</script>
</html>
